﻿<local:DocumentBase x:Class="WPFExcelReport.DSTPLAN"
           xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
          xmlns:local="clr-namespace:ReflectionStudio.Components.UserControls;assembly=ReflectionStudio.Core"
                xmlns:fd="clr-namespace:Labs.Filtering;assembly=ReflectionStudio.Core"
        xmlns:wep="clr-namespace:WPFExcelReport"
        xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls"
       Height="700" Width="1024" 
       Background="White" 
         Loaded="Window_Loaded"
        Title="DSTPLAN"  
     >
    <local:DocumentBase.Resources>
        <ucd:DD2ColorConverter  x:Key="dd2color"/>
    </local:DocumentBase.Resources>
    <Grid DataContext="{Binding}" Height="625" Width="978">
        <Grid.RowDefinitions>
            <RowDefinition Height="100" />
            <RowDefinition Height="150*" />
            <RowDefinition Height="200*" />
            <RowDefinition Height="50*" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="100*"></ColumnDefinition>
            <ColumnDefinition Width="100*"></ColumnDefinition>
        </Grid.ColumnDefinitions>
        <StackPanel Grid.ColumnSpan="2" Orientation="Vertical" Margin="0,0,3,65">            
            <WrapPanel Name="ZoneOrder" Width="969">
                <Label Content="输入厂编号（例如：D-3203）"    Width="230" Margin="10,0,0,0"  HorizontalAlignment="Left"   FontSize="18" VerticalAlignment="Center" Foreground="#FF141111" />
                <TextBox Name="txtORDERNO" Width="101" Margin="10,0,0,0"  HorizontalAlignment="Left" Panel.ZIndex="1"
                         KeyUp="txtART_KeyUp" Focusable="True" CharacterCasing="Upper" Background="Beige" MaxLength="20" FontSize="18" Foreground="#FF141111" Height="33" />
                <Label Content="销售交期从" Height="26" HorizontalAlignment="Left" Margin="10,0,0,0" Name="label1" VerticalAlignment="Center" Width="94" FontSize="18" />
                <DatePicker Height="25" HorizontalAlignment="Left" Margin="0,2,0,0" Name="FROM_SHIPPING_DATE" VerticalAlignment="Top" 
                                SelectedDateChanged ="FROM_SHIPPING_DATE_SelectedDateChanged" Width="95" />
                <Label Content="至" Height="28" HorizontalAlignment="Left" Margin="10,0,0,0" Name="label2" VerticalAlignment="Center" Width="19" FontSize="18" />
                <DatePicker Height="25" HorizontalAlignment="Left" Margin="0,2,0,0" Name="END_SHIPPING_DATE" VerticalAlignment="Top" 
                                SelectedDateChanged ="END_SHIPPING_DATE_SelectedDateChanged" Width="95" />
                
            </WrapPanel>            
        </StackPanel>
        <StackPanel Margin="0,36,3,12" Grid.ColumnSpan="2" Orientation="Vertical" >
            <WrapPanel>
                <Label Content="下单日期从" Height="26" HorizontalAlignment="Left" Margin="10,0,0,0" Name="label3" VerticalAlignment="Center" Width="94" FontSize="18" />
                <DatePicker Height="25" HorizontalAlignment="Left" Margin="0,2,0,0" Name="FROM_ORDER_DATE" VerticalAlignment="Top" 
                                SelectedDateChanged ="FROM_ORDER_DATE_SelectedDateChanged" Width="95" />
                <Label Content="至" Height="28" HorizontalAlignment="Left" Margin="10,0,0,0" Name="label4" VerticalAlignment="Center" Width="19" FontSize="18" />
                <DatePicker Height="25" HorizontalAlignment="Left" Margin="0,2,0,0" Name="END_ORDER_DATE" VerticalAlignment="Top" 
                                SelectedDateChanged ="END_ORDER_DATE_SelectedDateChanged" Width="95" />
                <Button  Height="30"  Width="30" Margin="10,0,0,0" Name="btnQuery" Click="btnQuery_Click"  KeyboardNavigation.TabIndex="3" IsDefault="True" TabIndex="10">
                    <Button.Background>
                        <ImageBrush ImageSource="/IntexReportClient;component/Images/Search.png" />
                    </Button.Background>
                </Button>
                <Button   Height="30" Margin="20,0,0,0"  Name="btnPrintPreview" Width="30" Click="btnPrintPreview_Click">
                    <Button.Background>
                        <ImageBrush ImageSource="/IntexReportClient;component/Images/Print.png" />
                    </Button.Background>
                </Button>
            </WrapPanel>
            <TextBlock Height="200">
                1.后整理，先累计小花号总数量和实际完成时期，更新大表
                2.织造，累计小花号对应PR单，总产出量，和完成时间
                3.浆纱，累计小花号的织轴产量
                4.染色，获取所有J/W纱的生产单，先更新大表完成时间，再更新大表的染色未完成时间（空白）。
            </TextBlock>
        </StackPanel>
        <StackPanel Margin="0,70,3,12" Grid.RowSpan="4" Grid.ColumnSpan="3">            
            <WrapPanel Width="972" Height="575">
                <DataGrid CanUserReorderColumns="True" 
                          CanUserResizeRows="True" CanUserSortColumns="True"
                          AutoGenerateColumns="False"   
                  EnableRowVirtualization="True"  
                  Width="969"
                  Height="537"
                  EnableColumnVirtualization="True"  
                  ScrollViewer.HorizontalScrollBarVisibility="Auto"
                  ScrollViewer.VerticalScrollBarVisibility="Auto"
                  RowDetailsVisibilityMode="VisibleWhenSelected" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
                                IsSynchronizedWithCurrentItem="True" Opacity="10" Visibility="Visible"
                               ItemsSource="{Binding}" x:Name="MasterDg" 
                               Grid.ColumnSpan="2" Margin="0,10,0,0" Grid.RowSpan="3" Grid.Row="1" DataContext="{Binding}">
                    <!--STARTDATE	NAME	ORDERNO	FPOS	ARTICLE	YARN	FDDIS	QTY	UNIT	REQDATE	ENDDATE	
                    GREIGE	WARP	RATE	TECHDATE	TECHDAT	PODATE	PODAT	GPSDATE	GPSDAT	GPEDATE	GPEDAT	
                    VWDATE	VWDAT	PRSDATE	PRSDAT	PREDATE	PREDAT	VADATE	VADAT	SHIPDATE	SHIPDAT	BEAM	
                    FACTORY	SUPPLIER	GPFACTORY	STATUS--> 
                    <DataGrid.Columns>
                        <DataGridTextColumn Binding="{Binding Path=STARTDATE}" Header="下单日期" Width="SizeToCells" MinWidth="60" />
                        <DataGridTextColumn Binding="{Binding Path=NAME}" Header="跟单员" Width="SizeToCells" MinWidth="40" />
                        <DataGridTextColumn Binding="{Binding Path=ORDERNO}" Header="厂编号" Width="SizeToCells" MinWidth="40" />
                        <DataGridTextColumn Binding="{Binding Path=FPOS}" Header="行号" Width="SizeToCells" MinWidth="20" />
                        <DataGridTextColumn Binding="{Binding Path=ARTICLE}" Header="小花号" Width="SizeToCells" MinWidth="50" />
                        <DataGridTextColumn Binding="{Binding Path=YARN}" Header="纱支" Width="SizeToCells" MinWidth="60" />
                        <DataGridTextColumn Binding="{Binding Path=FDDIS}" Header="规格" Width="SizeToCells" MinWidth="40" />
                        <DataGridTextColumn Binding="{Binding Path=QTY}" Header="合同数量" Width="SizeToCells" MinWidth="40" />
                        <DataGridTextColumn Binding="{Binding Path=UNIT}" Header="单位" Width="SizeToCells" MinWidth="20" />
                        <DataGridTextColumn Binding="{Binding Path=REQDATE}" Header="销售交期" Width="SizeToCells" MinWidth="50" />
                        <DataGridTextColumn Binding="{Binding Path=ENDDATE}" Header="计划交期" Width="SizeToCells" MinWidth="40" />
                        <DataGridTextColumn Binding="{Binding Path=GREIGE}" Header="工艺坯长" Width="SizeToCells" MinWidth="30" />
                        <DataGridTextColumn Binding="{Binding Path=WARP}" Header="工艺经长" Width="SizeToCells" MinWidth="30" />
                        <DataGridTextColumn Binding="{Binding Path=RATE}" Header="计划天数" Width="SizeToCells" MinWidth="20" />
                        <DataGridTextColumn Binding="{Binding Path=TECHDATE}" Header="工艺计划" Width="SizeToCells" MinWidth="40" />
                        <DataGridTextColumn Binding="{Binding Path=TECHDAT}" Header="工艺实际" Width="SizeToCells" MinWidth="30" />
                        <DataGridTextColumn Binding="{Binding Path=PODATE}" Header="原纱计划" Width="SizeToCells" MinWidth="40" />
                        <DataGridTextColumn Binding="{Binding Path=PODAT}" Header="原纱实际" Width="SizeToCells" MinWidth="30" />
                        <DataGridTextColumn Binding="{Binding Path=GPSDATE}" Header="投染计划" Width="SizeToCells" MinWidth="40" />
                        <DataGridTextColumn Binding="{Binding Path=GPSDAT}" Header="投染实际" Width="SizeToCells" MinWidth="30" />
                        <DataGridTextColumn Binding="{Binding Path=GPEDATE}" Header="染色计划" Width="SizeToCells" MinWidth="40" />
                        <DataGridTextColumn Binding="{Binding Path=GPEDAT}" Header="染色实际" Width="SizeToCells" MinWidth="30" />
                        <DataGridTextColumn Binding="{Binding Path=VWDATE}" Header="前织计划" Width="SizeToCells" MinWidth="40" />
                        <DataGridTextColumn Binding="{Binding Path=VWDAT}" Header="前织实际" Width="SizeToCells" MinWidth="30" />
                        <DataGridTextColumn Binding="{Binding Path=PRSDATE}" Header="织造计划" Width="SizeToCells" MinWidth="40" />
                        <DataGridTextColumn Binding="{Binding Path=PRSDAT}" Header="织造实际" Width="SizeToCells" MinWidth="30" />
                        <DataGridTextColumn Binding="{Binding Path=PREDATE}" Header="坯布计划" Width="SizeToCells" MinWidth="40" />
                        <DataGridTextColumn Binding="{Binding Path=PREDAT}" Header="坯布实际" Width="SizeToCells" MinWidth="30" />
                        <DataGridTextColumn Binding="{Binding Path=VADATE}" Header="整理计划" Width="SizeToCells" MinWidth="40" />
                        <DataGridTextColumn Binding="{Binding Path=VADAT}" Header="整理实际" Width="SizeToCells" MinWidth="30" />
                        <DataGridTextColumn Binding="{Binding Path=SHIPDATE}" Header="成品计划" Width="SizeToCells" MinWidth="40" />
                        <DataGridTextColumn Binding="{Binding Path=SHIPDAT}" Header="成品实际" Width="SizeToCells" MinWidth="30" />
                        <DataGridTextColumn Binding="{Binding Path=BEAM}" Header="回轴" Width="SizeToCells" MaxWidth="100" />
                        <DataGridTextColumn Binding="{Binding Path=FACTORY}" Header="工厂" Width="SizeToCells" MaxWidth="100" />
                        <DataGridTextColumn Binding="{Binding Path=SUPPLIER}" Header="原纱供应商" Width="SizeToCells" MaxWidth="50" />
                        <DataGridTextColumn Binding="{Binding Path=GPFACTORY}" Header="外加工染厂" Width="SizeToCells" MaxWidth="50" />
                    </DataGrid.Columns>
                </DataGrid>
            </WrapPanel>
        </StackPanel>
       
    </Grid>
</local:DocumentBase>
